
; There are 5 parameters at most, saved in
; ebx, ecx, edx, esi, edi in order.

%macro sys_call 2
global	%1
%1:
	mov	eax, %2
	mov	ebx, [esp + 4]
	mov	ecx, [esp + 8]
	mov	edx, [esp + 12]
	mov	esi, [esp + 16]
	mov	edi, [esp + 20]
	int	0x80
	ret
%endmacro

sys_call	sys_gettime,	0
sys_call	sys_getpid,	1
sys_call	sys_getppid,	2
sys_call	sys_fork,	3
sys_call	sys_alarm,	4
sys_call	sys_wake_up,	5
sys_call	sys_exec,	6
sys_call	sys_exit,	7
sys_call	sys_waitpid,	8
sys_call	sys_wait,	9
sys_call	sys_open,	10
sys_call	sys_close,	11
sys_call	sys_rm,		12
sys_call	sys_stat,	13
sys_call	sys_read,	14
sys_call	sys_write,	15
sys_call	sys_lseek,	16
sys_call	sys_mkdir,	17
sys_call	sys_rmdir,	18
sys_call	sys_flush,	19
sys_call	sys_opendir,	20
sys_call	sys_readdir,	21
sys_call	sys_read_tty,	22
sys_call	sys_write_tty,	23
sys_call	sys_format,	24
sys_call	sys_exec1,	25
sys_call	sys_debug,	26
sys_call	sys_shm_create,	27
sys_call	sys_shm_remove,	28
sys_call	sys_shm_attach,	29
sys_call	sys_shm_detach,	30
